<script type="text/javascript">
    {literal}
    $(document).ready(function() {
        $("#to_date").datepicker({ 
            dateFormat: "dd/mm/yy",
            firstDay: 1
        }); 
    });
    {/literal}
</script>

<h2 class="pageTitle">Cash status</h2>

<div class="menu-list">
    <form action="{$data.root}?input=cash_status" method="post">
        Report to date:
        <input name="to_date" value="{$data.to_date}" id="to_date" type="text" />
        
        <input value="Show" type="submit" />
    </form>
</div>
        
{if !empty($data.output)}
    <table class="list">
        <tr>
            <th><b>Name</b></th>
            {foreach $data.dates as $date => $d}
                <th><b>{$date}</b></th>
            {/foreach}
        </tr>
        {foreach $data.output as $i => $row}
            {if $i == -1}
                {assign var="bold" value='style="font-weight:bold"'}
            {else}
                {assign var="bold" value=''}
            {/if}
            <tr>
                <td {$bold}>{$row.name} {$row.surname}</td>
                {foreach $row.dates as $value}
                    <td {$bold}>{$value}</td>
                {/foreach}
            </tr>
        {/foreach}
    </table>
{/if}